package com.luoxiang.socialandroid.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.luoxiang.socialandroid.R;

import java.util.ArrayList;
import java.util.List;

public class TextBqAdapter extends RecyclerView.Adapter<TextBqAdapter.ViewHolder> {
    List<String> selectIdList = new ArrayList<>();

    public TextBqAdapter(List<String> selectIdList) {
        this.selectIdList = selectIdList;
    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.item_lable, parent, false);
        TextBqAdapter.ViewHolder holder = new TextBqAdapter.ViewHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
        holder.tx_lable.setText(selectIdList.get(position));
    }

    @Override
    public int getItemCount() {
        return selectIdList.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        TextView tx_lable;

        public ViewHolder(@NonNull View itemView) {
            super(itemView);
            tx_lable = itemView.findViewById(R.id.tx_lable);
        }
    }
}
